package org.example.nio2.handler;

import io.netty.channel.Channel;
import io.netty.channel.ChannelHandlerContext;
import org.example.nio2.vo.MsgRequest;
import org.example.nio2.vo.MsgResponse;

/**
 * @author liyishan
 * @date 2023/11/13 15:38
 * @apiNote
 */

public class MsgRequestHandler extends BaseHandler<MsgRequest>{
    @Override
    protected void session(ChannelHandlerContext ctx, Channel channel, MsgRequest request) {
        System.out.println("收到消息：" + request.getMsg());
        channel.writeAndFlush(new MsgResponse(request.getTalkId(),request.getUserId(),request.getMsg()));

    }
}
